package com.power.flowable.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  流程实例信息扩展表实体类
*/

@Entity
@ApiModel(value="流程实例信息扩展表")
@Data
@Table(name="Act_hi_procinst_ext")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Act_hi_procinst_ext.Act_hi_procinst_extPK.class) 用于复合组件
public class Act_hi_procinst_ext extends BaseModel implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    private String id;

    @ApiModelProperty(value = "业务主表id")
    private String applyid;

    @ApiModelProperty(value = "申请主体名称")
    private String applyname;

    @ApiModelProperty(value = "申请编号")
    private String applyno;

    @ApiModelProperty(value = "单位id")
    private Integer sectionid;

    @ApiModelProperty(value = "受理编号")
    private String acceptcode;

    @ApiModelProperty(value = "提交时间")
    private String subtime;

    @ApiModelProperty(value = "业务类型编码")
    private String biztypeid;

    @ApiModelProperty(value = "许可证类型")
    private Integer type;

    @ApiModelProperty(value = "当前计时的环节组id")
    private String scatid;

    @ApiModelProperty(value = "预审用户id")
    private String preuserid;

    @ApiModelProperty(value = "补正截止日期", example="2020-10-22")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date closingdate;

    @ApiModelProperty(value = "补正下达日期", example="2020-10-22")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date releasedate;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("applyname", this.getApplyname());
        map.put("applyno", this.getApplyno());
        map.put("sectionid", this.getSectionid());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Act_hi_procinst_extPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Act_hi_procinst_extPK pk = (Act_hi_procinst_extPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
